package org.unicom.configuration;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.boot.autoconfigure.quartz.QuartzDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DataSourceConfig {

    @Bean(name = "dataSourceTask")
    @ConfigurationProperties("spring.datasource.dynamic.datasource.local")
    @QuartzDataSource
    public DruidDataSource dataSourceTask () {
        return DruidDataSourceBuilder.create().build();
    }
}
